    <section class="suite">
      <h1>Command Control</h1>
      <dl>
      </dl>
    </section>
    <section class="suite">
      <h1>ResponseHooks Control</h1>
      <dl>
        <dt>Parse signInResponse</dt>
        <dd><pre><code>
		var message = '&lt;response id=&quot;12351341234324&quot; varsion=&quot;1.0&quot; success=&quot;true&quot;&gt;'
			+ '&lt;signInResponse id=&quot;asdklj23&quot; type=&quot;closed&quot; question=&quot;where to eat?&quot; numChoices=&quot;4&quot; numRounds=&quot;3&quot; position=&quot;3&quot;&gt;'
			+ '&lt;choice value=&quot;McDonald\'s&quot; index=&quot;0&quot;/&gt;'
			+ '&lt;choice value=&quot;Wendy\'s&quot; index=&quot;1&quot;/&gt;'
			+ '&lt;choice value=&quot;Burger King&quot; index=&quot;2&quot;/&gt;'
			+ '&lt;choice value=&quot;Sushi Palace&quot; index=&quot;3&quot;/&gt;'
			+ '&lt;/signInResponse&gt;'
			+ '&lt;/response&gt;';
		
		var session = new mSession(&quot;123456&quot;);
		var handler = new ccResponse();
		handler.handle(message, session);
		
		assert.equal(&quot;asdklj23&quot;, session.game);</code></pre></dd>
        <dt>Parse createResponse</dt>
        <dd><pre><code>
		var message = '&lt;response version=&quot;1.0&quot; id=&quot;589a39591271844e3fbe32bbb9281ad9&quot; success=&quot;true&quot;&gt;'
			+ '&lt;createResponse id=&quot;sjlk2sjkl&quot;/&gt;'
			+ '&lt;/response&gt;';
		
		var session = new mSession(&quot;123456&quot;);
		var handler = new ccResponse();
		handler.handle(message, session);
		
		assert.equal(&quot;sjlk2sjkl&quot;, session.game);</code></pre></dd>
      </dl>
    </section>
    <section class="suite">
      <h1>Response Entity</h1>
      <dl>
        <dt>Client Error</dt>
        <dd><pre><code>
		var res = new mResponse().clientError(100, &quot;Message&quot;);
		assert.equal(400, res.response.code, &quot;Invalid Response Code&quot;);
		assert.equal(&quot;error&quot;, res.response.status, &quot;Invalid Response Status&quot;);
		assert.equal(100, res.response.error.code, &quot;Invalid Error Code&quot;);
		assert.equal(&quot;Message&quot;, res.response.error.message, &quot;Invalid Error Message&quot;);</code></pre></dd>
        <dt>Server Error</dt>
        <dd><pre><code>
		var res = new mResponse().serverError(100, &quot;Message&quot;);
		assert.equal(500, res.response.code, &quot;Invalid Response Code&quot;);
		assert.equal(&quot;error&quot;, res.response.status, &quot;Invalid Response Status&quot;);
		assert.equal(100, res.response.error.code, &quot;Invalid Error Code&quot;);
		assert.equal(&quot;Message&quot;, res.response.error.message, &quot;Invalid Error Message&quot;);</code></pre></dd>
      </dl>
    </section>
    <section class="suite">
      <h1>Session Entity</h1>
      <dl>
        <dt>Create new SessionEntity</dt>
        <dd><pre><code>
		var testId = &quot;123456&quot;;
		var before = Date.now();
		
		session = new mSession(testId);
		
		assert.equal(session.id, testId, &quot;Wrong session ID!&quot;);
		assert.isNotNull(session.socket, &quot;No Socket&quot;);
		assert.ok(session.lastAccess &gt;= before, &quot;Invalid Timestamp&quot;);</code></pre></dd>
        <dt>Send a message to the DLServer</dt>
        <dd><pre><code>
		this.timeout(100);
		session.toServer({
			__XMLclass : &quot;request&quot;,
			id : &quot;asdfasdf&quot;,
			version : &quot;1.0&quot;,
			__XMLchildren : [{
				__XMLclass : &quot;createRequest&quot;,
				things : &quot;All of them&quot;
			}]
		});
		
		setTimeout(function() {
			assert.ok(session.serverBuffer.length &gt;= 1, &quot;ServerBuffer error: &quot; + session.serverBuffer.length);
			done();
		}, 50);</code></pre></dd>
        <dt>Receive asynchronous messages from DLServer</dt>
        <dd><pre><code>
		session.socket.on('data', function() {
			assert.ok(session.clientBuffer.length &gt;= 1, &quot;ClientBuffer error&quot;);
		});
		
		setTimeout(function() {
			done();
		}, 1000);</code></pre></dd>
        <dt>Connect to DLServer</dt>
        <dd><pre><code>
		this.timeout(500);
		
		session.socket.on('connect', function() {
			setTimeout(function() { // Wait for a response to be buffered
				assert.ok(session.serverConnected, &quot;Invalid 'ServerConnected' flag&quot;);
				assert.equal(session.serverBuffer.length, 0, &quot;Server Buffer not empty after connect&quot;);
				
				done();
			}, 50);
		});
		
		session.socket.on('error', function(e) {
			assert.ifError(e);
			done();
		});
		
		setTimeout(function() {
			session.start(9371, '127.0.0.1');
		}, 100);</code></pre></dd>
      </dl>
    </section>
